
/*
*
*sys_tick.h
*系统时钟滴答
*延时等
*
*
*/
#ifndef __SYS_TICK__
#define __SYS_TICK__

#include "alldefine.h"



#define TICKSTART_SIZE	20	//定时器数量

#define	LED_TICK		0
#define M26_TICK		1
#define	STIMELIST		2

//定时器状态
typedef enum
{
	TICK_DISABLE=0,
	TICK_ENABLE
}tTick;


//定时器设置返回状态
typedef enum
{
	TICK_ERROR=0,
	TICK_OK
}Tick_StatusTypeDef;



//定时器工作结构体
typedef struct
{
	tTick start;
	uint32_t time;
}tTickStart;


///声明变量
extern volatile uint32_t sys_tick_con;
extern tTickStart tickstart[TICKSTART_SIZE];


//声明函数
//定时器中断回调函数
extern void HAL_SYSTICK_Callback(void);

//定时器阻塞延时函数
extern void SYS_Delay_ms(uint32_t delay);


//定时器启用和禁用
extern Tick_StatusTypeDef Start_Tick(uint16_t tick);
extern Tick_StatusTypeDef Stop_Tick(uint16_t tick);






#endif

